import request from '../../../utils/request'

// 查询菜单列表
export function listMenu (query) {
  return request({
    url: '/system/auth/menuList',
    method: 'get',
    data: query
  })
}

// 查询菜单下拉树结构
export function treeSelect () {
  return request({
    url: '/system/auth/treeSelect',
    method: 'get'
  })
}

// 新增菜单
export function addMenu (data) {
  return request({
    url: '/system/auth/addMenu',
    method: 'post',
    params: data
  })
}
// 查询菜单 详情
export function getMenuDetailById (id) {
  return request({
    url: '/system/auth/getMenuDetailById?menuId=' + id,
    method: 'get'
  })
}
// 根据角色ID 查询菜单下拉树结构
export function roleMenuTreeSelect (roleId) {
  return request({
    url: '/system/auth/roleMenuTreeSelect' + roleId,
    method: 'get'
  })
}

// 修改菜单
export function updateMenu (data) {
  return request({
    url: '/system/auth/updateMenu',
    method: 'post',
    params: data
  })
}

// 删除菜单
export function delMenu (menuIds) {
  return request({
    url: '/system/auth/deleteMenu',
    method: 'delete',
    data: menuIds
  })
}
